function getFileName(filePath) {
  const pathList = filePath.split('/');
  return pathList[pathList.length - 2];
}

/**注册所有全局组件*/
export function registerGlobalComponents(app) {
  const com = import.meta.glob('@renderer/components/*/index.vue', { eager: true }); //eager:true拿到的module不是异步
  for (const key in com) {
    const { name, __file } = com[key].default;
    const comName = name ? name : getFileName(__file);
    app.component(comName, com[key].default);
  }
}
